package com.yueyang.sojourn.server.model.dto;

import com.yueyang.sojourn.server.model.enums.MerchSaleTypeEnum;
import com.yueyang.sojourn.server.model.enums.OrderTypeEnum;
import com.yueyang.sojourn.server.validation.annotation.EnumValid;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Positive;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 订单model
 * @author andy.yang
 * @summary
 * @Copyright (c) 2020, Yueyang Group All Rights Reserved.
 * @since 2020-03-17 10:45
 */
@Data
@ApiModel("新增订单")
public class AddOrderDto {

    /**
     * 商品id
     */
    @ApiModelProperty(value = "商品id", required = true)
    @NotNull(message = "[商品]不能为空")
    private Long merchId;

    @ApiModelProperty(value = "出行日期 yyyy-MM-dd")
    @NotNull(message = "[出行日期]不能为空")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date merchEffectDate;
//    /**
//     * 优惠类型 - 从商品中取
//     */
//    @ApiModelProperty(value = "优惠类型(枚举值): 1会员专属，2两人及以上，3限时 ")
//    @EnumValid(clazz = MerchSaleTypeEnum.class)
//    private List<Integer> sales;

    /**订单类型：普通商品、会员**/
    @ApiModelProperty(value = "订单类型：(1-普通商品", required = true)
    @NotNull(message = "[订单类型]不能为空")
    @EnumValid(clazz = OrderTypeEnum.class)
    private Integer type;

    /**
     * 游客id
     */
    @ApiModelProperty(value = "游客id")
    @NotNull(message = "[游客]不能为空")
    @NotEmpty(message = "[游客]不能为空")
    private List<Long> touristIds;

    /**联系人手机**/
    @ApiModelProperty(value = "联系人手机")
    @NotEmpty(message = "[联系人手机]不能为空")
    @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "[手机号]格式有误")
    private String contactPhone;

    /**联系人姓名**/
    @ApiModelProperty(value = "联系人姓名")
    @NotEmpty(message = "[联系人姓名]不能为空")
    private String contactName;

}
